<?php
/**
 * Chat message from other user
 * 
 * @package stanza.message
 */
class Zend_Jabber_Stanza_Response_Message_Chat extends Zend_Jabber_Stanza_Response_Message_Abstract {
	/**
	 * Get message subject
	 *
	 * @return string
	 */
    public function getSubject() {
	     return $this->dom->getElementsByTagName('subject')->item(0)->nodeValue;
	}

	/**
	 * Get message body
	 * 
	 * This is the actual text of the received message
	 *
	 * @return string
	 */
	public function getBody() {
	     return $this->dom->getElementsByTagName('body')->item(0)->nodeValue;
	}
	
	/**
	 * Get message thread identification string
	 *
	 * @return Zend_Jabber_Message_Thread
	 */
	public function getThread() {
	     return Zend_Jabber_Message_Thread::searchByString($this->dom->getElementsByTagName('thread')->item(0)->nodeValue);
	}

	public function isComposing() {
	    return $this->getElementsByTagName('composing') ? true : false;
	}
}
?>